<#import "/lib/composition.ftl" as ui />
<#import "/lib/spring.ftl" as spring />
<#import "/turbo_banner.ftl" as turboBanner />

<@ui.composition "/base.ftl">
  <#assign title in ui>
    ${model.title} 3D model
  </#assign>

  <#assign content in ui>
    <@turboBanner.show model.title />
  
    <div id="wrapper">
      <div class="container">           
        <hr>
        
        <div class="row">     
          <div class="span4"> 
            <div class="picture">
              <a href="<@spring.url '/attachment/${model.docId}?name=${(model.images[0].fullImage)!}'/>" rel="image">
                <img src="<@spring.url '/attachment/${model.docId}?name=${(model.images[0].previewImage)!}'/>" />
              </a>            
            </div>          
          </div>
          
          <div class="span8">                    
            <div class="row">
              <#if model.images?size gt 1>
                <#list model.images[1..] as image>
                <div class="span2" style="margin-bottom: 30px;">
                  <div class="picture">
                    <a href="<@spring.url '/attachment/${model.docId}?name=${image.fullImage}'/>" rel="image">
                      <img src="<@spring.url '/attachment/${model.docId}?name=${image.previewImage}'/>" onerror="this.style.display = 'none';" />
                    </a>            
                  </div>
                </div>
                </#list>            
              </#if>
            </div>                             
          </div>
        </div>
    
        <div class="row" style="margin-top: 20px;">
          <div class="span6">
            ${model.description}
          </div>            
        </div>
        
        <div class="row" style="margin-top: 20px;">
          <div class="span12">
            <div id="disqus_thread"></div>
            <script type="text/javascript">
                /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
                var disqus_shortname = 'testnastyashop'; // required: replace example with your forum shortname
        
                /* * * DON'T EDIT BELOW THIS LINE * * */
                (function() {
                    var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
                    dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
                    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
                })();
            </script>
            <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
            <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
          </div>
        </div>
          
        <div style="height:500px;">&nbsp;</div>        
      </div>
    </div>
  </#assign>
</@ui.composition>
